package org.dallasrowing.logbook.event;

import java.util.ArrayList;


public class ChangeHandlerImpl implements ChangeHandler {

	private ArrayList<ChangeListener> listeners = new ArrayList<ChangeListener>();
	
	public void register(ChangeListener listener) {
		listeners.add(listener);
	}

	public void notifyChanged() {
		for (ChangeListener c : listeners)
			c.hasChanged();
		
	}

	ChangeListener[] getListeners()
	{
		return listeners.toArray(new ChangeListener[listeners.size()]);
	}
}
